package com.xlisteven.feign;

import com.xlisteven.entity.Fruits;
import com.xlisteven.entity.Product;
import com.xlisteven.fallback.FruitsFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
@FeignClient(value = "cloud-fruits",fallbackFactory = FruitsFallback.class)
public interface FruitsClient {

    @GetMapping("/fruit/getFruitsList/{fId}")
    List<Fruits> getFruitsList(@PathVariable(name = "fId") Long fId);

    @PostMapping("/fruit/insert")
    void insert(@RequestBody List<Fruits> fruitsList);
}
